package com.estate.business.impl;

import java.util.List;

import com.estate.business.IndexService;
import com.estate.dao.AnnouncementDao;
import com.estate.dao.CompanyStuffDao;
import com.estate.dao.ForumDao;
import com.estate.dao.LawsDao;
import com.estate.dao.ThingsTodoDao;
import com.estate.struts.actionForms.IndexActionForm;
import com.estate.vo.impl.AnnouncementVo;
import com.estate.vo.impl.UserInfoVo;

public class IndexServiceImpl implements IndexService {
	private AnnouncementDao announcementDao;
	private CompanyStuffDao companyStuffDao;
	private LawsDao lawsDao;
	private ThingsTodoDao thingsDao;
	private ForumDao forumDao;

	public IndexActionForm getIndexForm(UserInfoVo userInfo) {
		IndexActionForm iaf = new IndexActionForm();
		
		iaf.setAnnouncementList(announcementDao.getIndexList());
		iaf.setCompanyStuffList(companyStuffDao.getIndexList());
		iaf.setLawsList(lawsDao.getIndexList());
		iaf.setThingsList(thingsDao.getIndexList(userInfo));
		iaf.setForumList(forumDao.getIndexList());
		
//		System.out.println(iaf.getAnnouncementList().size());
//		System.out.println(iaf.getCompanyStuffList().size());
//		System.out.println(iaf.getForumList().size());
//		System.out.println(iaf.getLawsList().size());
//		System.out.println(iaf.getThingsList().size());
		
		return iaf;
	}

	public AnnouncementDao getAnnouncementDao() {
		return announcementDao;
	}

	public void setAnnouncementDao(AnnouncementDao announcementDao) {
		this.announcementDao = announcementDao;
	}

	public CompanyStuffDao getCompanyStuffDao() {
		return companyStuffDao;
	}

	public void setCompanyStuffDao(CompanyStuffDao companyStuffDao) {
		this.companyStuffDao = companyStuffDao;
	}

	public LawsDao getLawsDao() {
		return lawsDao;
	}

	public void setLawsDao(LawsDao lawsDao) {
		this.lawsDao = lawsDao;
	}

	public ThingsTodoDao getThingsDao() {
		return thingsDao;
	}

	public void setThingsDao(ThingsTodoDao thingsDao) {
		this.thingsDao = thingsDao;
	}

	public ForumDao getForumDao() {
		return forumDao;
	}

	public void setForumDao(ForumDao forumDao) {
		this.forumDao = forumDao;
	}
}
